home *** CD-ROM | disk | FTP | other *** search
/ PC Play 129 / pc play 129.iso / Demo / man2 / man2.exe / scenarios / train / Train 05.scl < prev    next >
Encoding:
Text File  |  2005-11-28  |  5.5 KB  |  177 lines

  1.  scenario = GetProperties()
  2. scenario.ScenarioType = 1
  3. scenario.Title = "sc_Train_05_00"
  4. scenario.Map = "Beotorum.dat"
  5. scenario.Description = "sc_Train_05_01"
  6. scenario.Picture = "Train 05.dds"
  7. scenario.iSortOrder = 3
  8.  
  9. scenario.vShowMessageBoxes[STDDT_AUTOFINISH_COMBAT] = false
  10. scenario.vShowMessageBoxes[STDDT_COMBAT_PHASE] = false
  11. scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_CAPITAL] = false
  12. scenario.vShowMessageBoxes[STDDT_YOU_CLEARED_TERRITORY] = false
  13. scenario.vShowMessageBoxes[STDDT_ENEMY_CLEARED_TERRITORY] = false
  14. scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_COUNTRY] = false
  15. scenario.vShowMessageBoxes[STDDT_ENEMY_CAPTURED_COUNTRY] = false
  16.  
  17. Player(PT_PLAYER, RACE_HUMANS)
  18. Player(PT_AI, RACE_ALIENS)
  19.  
  20. SetInitialCamera(-0.998092, 0.000000, 0.061746, 0.000000, -0.048500, 0.618885, -0.783983, 0.000000,-0.038214, -0.785482, -0.617704, 0.000000,1086.430786, 352.132141, -1211.224731, 1.000000)
  21.  
  22. function InitialMOB()
  23.     StartMOB(1)
  24.  
  25.     MoveUnit(1, 16, 44)
  26.     MoveUnit(2, 17, 43)
  27.     MoveUnit(3, 16, 42)
  28.     MoveUnit(4, 17, 41)
  29.     MoveUnit(5, 17, 39)
  30.  
  31.     
  32.     ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_05_02")
  33.  
  34.     FlyCamera(-0.970719, 0.000000, -0.240218, 0.000000, 0.201668, 0.543327, -0.814939, 0.000000,0.130517, -0.839521, -0.527418, 0.000000,1070.245972, 257.881256, -1502.766968, 1.000000)
  35.  
  36.     ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_05_03")
  37.  
  38.     --FlyCamera(-0.518083, -0.000000, -0.855330, 0.000000, 0.682087, 0.603379, -0.413147, 0.000000,0.516089, -0.797454, -0.312601, 0.000000,1075.297241, 115.674759, -1676.306030, 1.000000)
  39.         FlyCamera(-0.895584, 0.000000, -0.444892, 0.000000, 0.288132, 0.761943, -0.580020, 0.000000,0.338982, -0.647645, -0.682384, 0.000000,1071.141846, 154.296844, -1627.222290, 1.000000)
  40.  
  41.     SelectUnit2(4102)
  42.     ShowXBallon(2, ARTILLERY, MBS_LEFT, 421, 646, "sc_Train_05_04")
  43.     ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_05_05")
  44.     UnselectUnit2(4102)
  45.  
  46.     --FlyCamera(0.980354, 0.000000, 0.197247, 0.000000, -0.165900, 0.540919, 0.824551, 0.000000, -0.106695, -0.841075, 0.530292, 0.000000, 1163.487671, 380.826782, -1745.963623, 1.000000)
  47.         FlyCamera(0.953696, 0.000000, -0.300771, 0.000000, 0.195547, 0.759803, 0.620049, 0.000000,0.228527, -0.650154, 0.724621, 0.000000,1079.368530, 154.410767, -1766.846802, 1.000000)
  48.  
  49.     SetupUnit(4098, PILLBOX, 16, 46)
  50.     SetupUnit(4099, PILLBOX, 17, 45)
  51.     SetupUnit(4100, PILLBOX, 18, 44)
  52.     SetupUnit(4101, PILLBOX, 19, 45)
  53.     ShowXBallon(4, PILLBOX, MBS_LEFT, 580, 325, "sc_Train_05_06")
  54.         FlyCamera(0.980354, 0.000000, 0.197247, 0.000000, -0.165900, 0.540919, 0.824551, 0.000000, -0.106695, -0.841075, 0.530292, 0.000000, 1163.487671, 380.826782, -1745.963623, 1.000000)
  55.     ShowBallon(5, -1, MBS_CENTER, 17, 39, "sc_Train_05_07")
  56.  
  57.     FinishMOB()
  58. end
  59.  
  60. function OnUnitDead(unit)
  61.     if(unit == 4099) then
  62.         StartMOB(1)
  63.         StoreCamera()
  64.         FlyCamera(0.954358, 0.000000, 0.298664, 0.000000, -0.254001, 0.526045, 0.811640, 0.000000, -0.157111, -0.850457, 0.502035, 0.000000, 1268.746826, 297.795807, -1738.909058, 1.000000)
  65.         ShowBallon(10, -1, MBS_LEFT, 17, 45, "sc_Train_05_08")
  66.         RestoreCamera()
  67.         FinishMOB()
  68.     end
  69.  
  70.     if GetAliveUnitsAmount(COLOR_RED) == 0 then
  71.         StartMOB(1)
  72.         ShowXBallon(4, -1, MBS_CENTER, 599, 381, "sc_Train_05_09")
  73.         ShowXBallon(4, -1, MBS_CENTER, 599, 381, "sc_Train_05_10")
  74.         FinishMOB()
  75.     end
  76. end
  77.  
  78. old_prompt = ""
  79.  
  80. function OnUpdate()
  81.     if IsAlive(4098) and IsDead(4099) and IsAlive(4100) and IsAlive(4101) and IsAlive(4103) then
  82.         local pos = GetPos(4103)
  83.         if pos.x ~= 17 or pos.y ~= 45 then
  84.             ShowPrompting("sc_Train_05_11")
  85.             return
  86.         end
  87.     end
  88.  
  89.     local bRocketUnderFire = false
  90.  
  91.     for enemy = 1, 5 do
  92.         if CanAttackThisTurn(enemy, 4102, true) then
  93.             bRocketUnderFire = true
  94.         end
  95.     end
  96.  
  97.     if bRocketUnderFire then
  98.         ShowPrompting("sc_Train_05_12")
  99.         return
  100.     end
  101.  
  102.         if not AllUnitsMovedAndFiredIfCould() then
  103.         ShowPrompting("sc_Train_05_13")
  104.     else
  105.         ShowPrompting("sc_Train_finish_phase")
  106.     end
  107. end
  108.  
  109. function OnEndAITurn()
  110.     local bRocketUnderFire = false
  111.  
  112.     for enemy = 1, 5 do
  113.         if CanAttackThisTurn(enemy, 4102, true) then
  114.             bRocketUnderFire = true
  115.         end
  116.     end
  117.  
  118.     if bRocketUnderFire then
  119.         StartMOB(1)
  120.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_05_14")
  121.         FinishMOB(1)
  122.     end
  123. end
  124.  
  125. function OnHexClicked(x, y, clicked_unit, selected_unit, command)
  126.     if GetTurnNumber( COLOR_GREEN ) == 0 then
  127.         if clicked_unit == 4103 and command == CMD_SELECT then
  128.             StartMOB(1)
  129.             ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_05_15")
  130.             FinishMOB(1)
  131.         end
  132.     elseif GetTurnNumber( COLOR_GREEN ) == 1 then
  133.         if selected_unit == 4103 and command == CMD_MOVE then
  134.             if x ~= 17 or y ~= 45 then
  135.                 IncorrectAction("sc_Train_01_05")
  136.             end
  137.         end
  138.     end
  139. end
  140.  
  141. function CheckForVictory()
  142.     if GetAliveUnitsAmount(COLOR_RED) == 0 then return GAMERESULT_VICTORY end
  143.     if GetAliveUnitsAmount(COLOR_GREEN) == 0 then return GAMERESULT_DEFEAT end
  144.     return GAMERESULT_NONE
  145. end
  146.  
  147. function aiDefence(country)
  148.     aiMustNot()
  149. end
  150.  
  151. function aiUnit( unit )
  152.     if (unit == 4099) then
  153.         aiAddValue(2)
  154.     end
  155. end
  156.  
  157. function InitialSetup()
  158.     Country(16, ALLIANCE_FNU_ALLY)
  159.     Money(16, MONEY_GUERRILLA, 0)
  160.     Money(16, MONEY_TOTAL_REVENUE, 0)
  161.     PlaceCapital(16, 19, 51)
  162.  
  163.     Country(17, ALLIANCE_FL_ALLY)
  164.     Money(17, MONEY_GUERRILLA, 0)
  165.     Money(17, MONEY_TOTAL_REVENUE, 0)
  166.  
  167.     SetupUnit(4102, ARTILLERY, 18, 48)
  168.     SetupUnit(4103, TANK, 18, 46)
  169.     SetMP(4103, 0)
  170.  
  171.     SetupUnit(1, TANKA, 16, 40)
  172.     SetupUnit(2, TANKA, 17, 39)
  173.     SetupUnit(3, TANKA, 16, 38)
  174.     SetupUnit(4, TANKA, 17, 37)
  175.     SetupUnit(5, TANKA, 17, 35)
  176. end
  177.